import { IToolTip } from "../../../../../com/mui/manager/IToolTip";
import { DefInfo } from "../../../resource/info/DefInfo";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { Language } from "../../../../../extend/language/Language";
import { LGXBMap } from "../map/LGXBMap";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
//class TipRender
    
    export  class TipRender /* flash.display.Sprite */ implements IToolTip
    {
        constructor()
        {
            
            this.initView();
            return;
        }

        public set data(arg1)
        {
            this._data = arg1 as DefInfo;
            this._tipTitle.text = this._data.name;
            this.icon.bitmapData = GlobalClass.getBitmapData(this._data.text1);
            this._tipTxtField.htmlText = this._data.text2;
            this._tipBg.height = this._tipTxtField.y + this._tipTxtField.textHeight + 10;
            return;
        }

        /* internal  */initView(): void
        {
            this._tipBg = ObjCreate.createBg(0, 0, 250, 240, this, ImagesConst.ToolTipBg);
            this.icon = new Object /* flash.display.Bitmap */();
            var loc5;
            this.icon.y = loc5 = 8;
            this.icon.x = loc5;
            this.addChild(this.icon);
            var loc1=GlobalStyle.textFormat6;
            loc1.size = 30;
            ObjCreate.createTextField(Language.getString(380008), LGXBMap.instance.grid_w + 20, 12, 200, 40, this, loc1);
            ObjCreate.createTextField(Language.getString(380009), 14, 55, 200, 25, this);
            loc1.size = 20;
            this._tipTitle = ObjCreate.createTextField("", 16, 73, 200, 30, this, loc1);
            var loc2=GlobalStyle.color2;
            var loc3=GlobalStyle.color5;
            var loc4;
            (loc4 = GlobalStyle.textFormat1).leading = 5;
            this._tipTxtField = ObjCreate.createTextField("", 40, 98, 200, 10, this, loc4);
            this._tipTxtField.multiline = loc5 = true;
            this._tipTxtField.wordWrap = loc5;
            this._tipTxtField.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        /* internal */ /* var */_data: DefInfo;

        /* internal */ /* var */_tipBg: ScaleBitmap;

        /* internal */ /* var */icon: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tipTxtField: Object /* flash.text.TextField */;

        /* internal */ /* var */_tipTitle: Object /* flash.text.TextField */;
    }
